package com.tshopping.controller;

import com.tshopping.bean.User;
import com.tshopping.service.UserService;
import com.tshopping.util.ResponseData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @name: UpdatePasswordController
 * @description: 修改密码页面控制器
 * @author: Jackeys
 * @date: 2020-12-19 14:35
 */
@RestController
@RequestMapping("/UpdatePasswordController")
@CrossOrigin
public class UpdatePasswordController {
    @Autowired
    private UserService userService;

    @PostMapping(value = "/updatePassword")
    /**
     * @description 修改用户密码
     * @Param: newPassword
     * @Param: oldPassword
     * @Param: email
     * @return ResponseData
     * @author Jackeys
     * @date 2020-12-24 21:31
     */
    public ResponseData updatePassword(String newPassword, String oldPassword, String email){
        return userService.updatePassword(newPassword,oldPassword,email);
    }
}
